home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 051-060 / amok58 / multimem / multimem.doc next >
Text File  |  1993-11-04  |  2KB  |  67 lines

  1.  
  2.  
  3.                           MultiMem
  4.                          ==========
  5.  
  6. Copyrigth © 1991 by Hartmut Goebel
  7.  
  8. Feel free to copy and use this module, but keep the copyright note
  9. intact.
  10.  
  11.  
  12. MultiMem is a module, which enables You to manage multible intependent
  13. memory-heaps.
  14.  
  15. With NEW() (or OberonLib.New()) allocated memory-blocks can only be
  16. deallocated block by blok - or automaticly at the end of the programm.
  17. In some cases it's necessary to free memory - or parts of it - while
  18. execution (e.g. a new compiler parse), but not possible or to complicated,
  19. to deallocate the momory-blocks one by one (e.g. komplex list-constucts).
  20.  
  21. This is, where MultiMem helps You!
  22.  
  23. You can manage multipe intependent merory-heaps and free each one as You
  24. will.
  25.  
  26. TYPE
  27.   HeapPtr = POINTER TO Heap;
  28.  
  29. PROCEDURE NewHeap(VAR heap: HeapPtr);
  30.  
  31.   Crerates a new heap.
  32.  
  33.  
  34. PROCEDURE EmptyHeap(heap: HeapPtr);
  35.  
  36.   Frees the contents of the given <heap>.
  37.   The heap continues to exist, but is empty.
  38.  
  39.  
  40. PROCEDURE DisposeHeap(VAR heap: HeapPtr);
  41.  
  42.   Frees the given <heap> together with all it's contents.
  43.   Teh <heap> will be destroied and must not be used any more.
  44.  
  45.  
  46. PROCEDURE New(heap: HeapPtr; VAR adr: LONGINT; size: LONGINT);
  47. PROCEDURE Dispose(VAR adr: LONGINT);
  48.  
  49.  
  50.   New() allocated in <heap> a memory-block of <size> and moves it's
  51.   address in <adr>. <adr> is NIL, if action failed.
  52.   The memory allocated is of type OberonLib.MemReqs.
  53.   <heap> must have been created with NewHeap():
  54.   Dispose() frees the with New() allocated memory.
  55.  
  56.  
  57. Insider-Information:
  58.   With New() or OberonLib.New() allocated momory-blocks are lonword
  59.   alligned, but do not start at an address divitable through 8.
  60.   But this should be from interest in almost no cases.
  61.   It has no effect on the funcionality of this module!!
  62.   If You don't know, whatfor this information is, it's absolutly
  63.   irrelavant for You!
  64.  
  65. ++ hartmut
  66.  
  67.